﻿namespace AppLab.Web
{
    using System;
    using System.ComponentModel.DataAnnotations;
    using System.Data;
    using System.Data.Objects.DataClasses;
    using System.Linq;
    using AppLab.Data.Models;
    using AppLab.Web.Resources;
    using Wicresoft.AppFlow.Flows;

    public class HistoryData : FormData
    {
        #region 表单验收报告

        [Display(AutoGenerateField = false)]
        public bool SpectionReport { get; set; }
        /// <summary>
        /// 验收报告
        /// </summary>
        string inspectionReport;
        [Display(Order = 8, Name = "ReviewCustomDataFormInspectionReportLable", ResourceType = typeof(RegistrationDataResources))]
        public string InspectionReport { get { return inspectionReport; } set { inspectionReport = value; } }

        #endregion

        [Display(AutoGenerateField = false)]
        public DateTime? TestEndTime { get; set; }

        [Display(AutoGenerateField = false)]
        public DateTime? ReviewEndTime { get; set; }

        [Display(AutoGenerateField = false)]
        public string ReviewComment { get; set; }

        [Display(AutoGenerateField = false)]
        public int? Priority { get; set; }

        [Display(AutoGenerateField = false)]
        public DateTime? TestTaskEAT { get; set; }

        [Display(AutoGenerateField = false)]
        public int? State { get; set; }

        [Display(AutoGenerateField = false)]
        public string StateStr
        {
            get
            {
                switch (State)
                {
                    case 0: return "等待提交";
                    case 1: return "等待审核";
                    case 2: return "等待验收";
                    case 3: return "审核未通过";
                    case 4: return "验收通过";
                    case 5: return "验收未通过";
                    case 6: return "验收保留意见";
                    case 7: return "发布成功";
                    default: return "客户取消";
                }
            }
        }

        //发布方式
        [Display(AutoGenerateField = false)]
        public string PublishedStr { get; set; }
    }
}